<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>编辑订单 - 管理后台</title>
    <link rel="stylesheet" href="/static/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/public.css?s=0.01" media="all"/>
</head>
<body class="childrenBody">
<form class="layui-form " action="" method="post">
    <input name="order_id" value="{$info['order_id']}" type="hidden">
    <div class="layui-col-md12 layui-col-space10">
        <div class="layui-col-md7 layui-col-xs12">
            <blockquote class="layui-elem-quote title"><i class="seraph icon-caidan"></i> 基本信息</blockquote>
            <div class="border">
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">订单号：</label>

                    <div class="layui-form-mid">{$info['transaction']}</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">产品：</label>
                    <div class="layui-form-mid">{$info['product_name']}</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">产品价格：</label>
                    <div class="layui-form-mid">{$info['product_price']}元</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">订单价格：</label>
                    <div class="layui-form-mid">{$info['price']}元</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">下单时间：</label>
                    <div class="layui-form-mid">{$info['create_time']}</div>
                </div>
                {if condition="$info['pay_time'] != ''"}
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">付定金时间：</label>
                    <div class="layui-form-mid">{$info['pay_time']}</div>
                </div>
                {/if}
                {if condition="$info['status'] == 2"}
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">付全款时间：</label>
                    <div class="layui-form-mid">{$info['all_pay_time']}</div>
                </div>
                {/if}
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">状态：</label>
                    {if condition="$info['status'] == -1"}
                    <input type="hidden" name="status" value="-1" >
                    <div class="layui-form-mid">已失效 {if condition="$info['refund_time']"}(已退款{$info['refund_time']}){/if}</div>
                    {/if}
                    {if condition="$info['status'] == -3"}
                    <input type="hidden" name="status" value="-3" >
                    <div class="layui-form-mid">退款中</div>
                    {/if}
                    {if condition="$info['status'] == 0"}
                    <div class="layui-input-block" >
                        <input type="radio" name="status" value="-1" title="失效">
                        <input type="radio" name="status" checked value="0" title="未付款">
                        <input type="radio" name="status" value="1" title="支付定金">
                        <input type="radio" name="status" value="2" title="支付全款">
                    </div>
                    {/if}
                    {if condition="$info['status'] == 1"}
                    <div class="layui-input-block" >
                        <input type="radio" name="status" value="-3" title="失效/退款">
                        <input type="radio" name="status" checked value="1" title="支付定金">
                        <input type="radio" name="status" value="2" title="支付全款">
                    </div>
                    {/if}
                    {if condition="$info['status'] == 2"}
                    <input type="hidden" name="status" value="2" >
                    <div class="layui-form-mid">已支付全款</div>
                    {/if}
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">备注：</label>
                    <div class="layui-input-block" style="margin-left: 150px;">
                        <textarea name="description" class="layui-textarea" type="text" rows="5">{$info['description']}</textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">&nbsp;</label>
                    <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="demo1">提交保存</button>
                </div>
            </div>
        </div>
        <div class="layui-col-md5 layui-col-xs12">
            <blockquote class="layui-elem-quote title">
                <i class="seraph icon-caidan"></i> 用户信息
            </blockquote>
            <div class="border">
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">用户：</label>
                    <div class="layui-form-mid">{$info['nickname']}</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">公司名称：</label>
                    <div class="layui-form-mid">{$info['company']}</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">联系人：</label>
                    <div class="layui-form-mid">
                        {$info['name']}
                        （{if condition="$info['sex'] == 1"}男{elseif condition="$info['sex'] == 2"/}女{else/}未知{/if}）
                        （{$info['position']}）
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">联系电话：</label>
                    <div class="layui-form-mid">{$info['phone']}</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width:120px;">公司地址：</label>
                    <div class="layui-form-mid">{$info['address']}</div>
                </div>
            </div>
        </div>
    </div>
</form>
<script src="/static/layui.js"></script>
<script>
    var $;
    layui.use(['element', 'jquery', 'layer', 'form'], function () {
        var element = layui.element, layer = layui.layer, form = layui.form;
        $ = layui.$;
        form.on('submit(demo1)', function (data) {
            var index = layer.load(1);
            $.post('{:url("productOrder/editOrder")}', data.field, function (data) {
                if (data.code == 0) {
                    layer.close(index);
                    layer.msg(data.msg, {
                        time: 3000,
                        icon: 1
                    }, function () {
                        parent.layer.closeAll("iframe");
                        parent.layui.tableIns.reload();
                    });
                } else {
                    layer.close(index);
                    layer.msg(data.msg, {icon: 5, shift: 6});
                }
            });
            return false;
        });
    });
</script>
</body>
</html>